using System;

using Sustainalytics.Entities;
using Sustainalytics.Utils;

namespace Sustainalytics.Portfolios.BL
{
    public class PortfolioBuilder
    {
        public static Portfolio Build(
            Guid portfolioId, 
            string portfolioName, 
            PortfolioSharingStatus status, 
            PortfolioUserClaims userClaim)
        {
            return Build(portfolioId, portfolioName, status, DateTime.Today, userClaim);
        }

        public static Portfolio Build(
            Guid portfolioId, 
            string portfolioName, 
            PortfolioSharingStatus status, 
            DateTime dateInserted, 
            PortfolioUserClaims userClaim)
        {
            return new Portfolio
                       {
                           Id = portfolioId, 
                           Name = portfolioName, 
                           DataCreated = dateInserted, 
                           SharingStatus = status, 
                           DateModified = DateTime.Today, 
                           AddedByFullName = userClaim.UserFullName, 
                           AddedByUserId = userClaim.UserId, 
                           AddedByUserName = userClaim.UserName, 
                           AccountIds = new[] { userClaim.AccountId }, 
                       };
        }
    }
}